<template>
    <div>
        <Head title="活动专区"></Head>
        <div class="sub-child">
            <ul>
                <li v-for="(v,i) in giftList" :key="i">
                    <img :src="v.data[0].imgurl" alt="">
                </li>
            </ul>
        </div>
        <Foot></Foot>
    </div>
</template>


<script>
import {mapState,mapMutations} from 'vuex';
import { Notify } from 'vant'
export default {
    data(){
        return{
            // list:[],
        }
    },
    computed:{
        ...mapState(['giftList'])
    },
    methods:{
        ...mapMutations(['setGiftList']),
    },
    mounted(){
        if(!this.giftList.length>0){
            this.$ajax.getWruru({
                        type:'activity'
                    }).then(res=>{
                        // console.log(res)
                        if(res.code==200){
                            // this.list=res.response_data[0].items;
                            this.setGiftList(res.response_data[0].items)
                            console.log(res)
                        }else{
                            Notify({ type: 'warning', message: res.msg });
                        }
                    })
        }

        
        
    },
}
</script>

<style lang="scss" scoped>
ul{
    padding-bottom: 50px;
 li{
        width: 100%;
        img{
            width: 100%;
        }
    }
}
   
</style>